<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    function getQueryStringArgs(m_url) {

        //取得 字符串?号后面
        // let qs = (location.search.length>0?location.search.length : '');
        //若有参数 那么就 截取?后面, 没有参数就将 location 检测的截取
        let qs = m_url.split("?")[1] || location.search.length>0?location.search.length : '';
        console.log('qs :', qs);

        //存数据
        let args={}

        //取得每一项 &区分 变成数组每个存起来  [name=xxx,age=12] 形式的数组
        items = qs.length ? qs.split("&"):[];
        item = null;
        name=null;
        value=null;

        let i = 0;
        let len = items.length;

        //循环数组
        for(let i=0; i<len; i++)
        {
            //赋值
            //items[1] --> name=xxx 字符串    
            item = items[i].split('=');     //[name,xxx]  数组 
            name = decodeURIComponent(item[0]);  //name
            value= decodeURIComponent(item[1]);   //xxx
            console.log('name :', name);
            if(name.length) {
                args[name] = value;
            }
        }
        return args;
    }
    let m_url = "comment_ajax.asp?id=number_id&vote_number=good_bad";
    let args = getQueryStringArgs(m_url)
    console.log('args :', args);
    </script>
</body>
</html>